import 'package:flutter/material.dart';

/// 设备类型枚举
enum DeviceType {
  airConditioner,
  airPurifier,
  other
}

/// 设备模型类
class DeviceModel {
  final String id;
  final String name;
  final String roomName;
  final DeviceType type;
  final String imageUrl;
  bool isOn;
  final Map<String, dynamic> properties;

  DeviceModel({
    required this.id,
    required this.name,
    required this.roomName,
    required this.type,
    required this.imageUrl,
    this.isOn = false,
    this.properties = const {},
  });

  /// 创建设备副本
  DeviceModel copyWith({
    String? id,
    String? name,
    String? roomName,
    DeviceType? type,
    String? imageUrl,
    bool? isOn,
    Map<String, dynamic>? properties,
  }) {
    return DeviceModel(
      id: id ?? this.id,
      name: name ?? this.name,
      roomName: roomName ?? this.roomName,
      type: type ?? this.type,
      imageUrl: imageUrl ?? this.imageUrl,
      isOn: isOn ?? this.isOn,
      properties: properties ?? this.properties,
    );
  }
}

/// 房间模型类
class RoomModel {
  final String id;
  final String name;
  final IconData icon;

  RoomModel({
    required this.id,
    required this.name,
    required this.icon,
  });
}